<?php
namespace app\driver\validate;


use think\validate;

class Driver extends Validate
{
    protected $regex = ['password' => '^(?=.*[a-zA-Z0-9].*)(?=.*[a-zA-Z\\W].*)(?=.*[0-9\\W].*).{6,20}$'];
    protected $rule = [
        'mobile' => 'require|mobile',
        'name' => 'require',
        'verify_code' => 'require',
        'order_id' => 'require',
        'id' => 'require',
        'site' => 'require',
        'type' => 'require',
        'mySite' => 'require',
        'bottle_put' => 'require',
        'bottle_send' => 'require',

    ];

    protected $message = [
        'mobile.require'    => '请输入手机号',
        'mobile.mobile'     => '非有效手机号码',
        'name.require'     => '请输入真实姓名',
        'verify_code.require'     => '验证码不能为空',
        'order_id.require'     => '订单ID不能为空',
        'id.require'     => 'ID不能为空',
        'site.require'     => '站点不能为空',
        'type.require'     => '类型不能为空',
        'mySite.require'     => '所属站点不能为空',
        'bottle_put.require'     => '收瓶编号不能为空',
        'bottle_send.require'     => '送瓶编号不能为空',

    ];


    protected $scene = [

        'login'  =>  ['mobile', 'verify_code'],
        'detail'  =>  ['order_id'],
        'site'  =>  ['id'],
        'save'  =>  ['type', 'site', 'mySite'],
        'sm'  =>  ['order_id',  'bottle_send'],

    ];
}
